import i18n from '@/lang'
import { managePerms } from '@/config/permission/index'
import Vue from "vue";
import moment from 'moment'
import { width } from 'window-size';
export const vehicleColumns = [
  {
    title: 'VIN',
    dataIndex: 'vin',
    scopedSlots: { customRender: 'vin' },
    width: 220
  },
  {
    title: '品牌',
    dataIndex: 'company',
    scopedSlots: { customRender: 'company' },
    customRender: (text, record, index) => {
      return Vue.$store.getters.getDictCodeObj('companyDictCode')[text] || text;
    },
    width: 100
  },
  {
    title: i18n.t('brandName'),
    dataIndex: 'brandName',
    scopedSlots: { customRender: 'brandName' },
    width: 140
  },
  {
    title: i18n.t('modelName'),
    dataIndex: 'modelName',
    scopedSlots: { customRender: 'modelName' },
    width: 140
  },
  {
    title: '车型代码',
    dataIndex: 'modelCode',
    scopedSlots: { customRender: 'modelCode' },
    width: 140
  },
  {
    title: '生产车系名称',
    dataIndex: 'productionSeries',
    scopedSlots: { customRender: 'productionSeries' },
    width: 140
  },
  {
    title: '款型名称',
    dataIndex: 'modelStyleName',
    scopedSlots: { customRender: 'modelStyleName' },
    width: 140
  },
  {
    title: '子车型代码',
    scopedSlots: { customRender: 'subModelCode' },
    width: 140
  },
  {
    title: '生产车型名称',
    dataIndex: 'productionModel',
    scopedSlots: { customRender: 'productionModel' },
    width: 140
  },
  {
    title: '公告车型',
    dataIndex: 'publishCode',
    scopedSlots: { customRender: 'publishCode' },
    width: 140
  },
  {
    title: i18n.t('年款'),
    scopedSlots: { customRender: 'makeYear' },
    width: 100
  },
  {
    title: i18n.t('车辆大版本'),
    dataIndex: 'gcyVehicleVersion',
    scopedSlots: { customRender: 'gcyVehicleVersion' },
    width: 100
  },
  {
    title: i18n.t('智驾域版本'),
    dataIndex: 'vehicleVersion',
    scopedSlots: { customRender: 'vehicleVersion' },
    width: 100
  },
  {
    title: i18n.t('Dilink版本'),
    dataIndex: 'dilinkVersion',
    scopedSlots: { customRender: 'dilinkVersion' },
    width: 100
  },
  {
    title: i18n.t('最近升级时间'),
    dataIndex: 'lastUpgradeSuccessTime',
    scopedSlots: { customRender: 'lastUpgradeSuccessTime' },
    customRender: (text, record, index) => {
      return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : '-'
    },
    width: 160
  },
  {
    title: i18n.t('数据来源'),
    dataIndex: 'dataType',
    scopedSlots: { customRender: 'dataType' },
    customRender: (text, record, index) => {
      return Vue.$store.getters.getDictCodeObj('configModelDataFromDictCode')[text] || text;
    },
    width: 100
  },
  {
    title: i18n.t('vehicleType'),
    dataIndex: 'vehicleType',
    scopedSlots: { customRender: 'vehicleType' },
    customRender: (text, record, index) => {
      return i18n.t(Vue.$store.state.vehicle.types.find(item => item.id == text).name);
    },
    width: 100
  },
  {
    title: '主机零件号',
    dataIndex: 'mainframePartCode',
    scopedSlots: { customRender: 'mainframePartCode' },
    width: 140
  },
  {
    title: '主机SN',
    dataIndex: 'mainframeSn',
    scopedSlots: { customRender: 'mainframeSn' },
    width: 140
  },
  {
    title: 'ICCID',
    dataIndex: 'iccId',
    scopedSlots: { customRender: 'iccId' },
    width: 200
  },
  {
    title: '库位',
    dataIndex: 'locationDesc',
    width: 100,
    scopedSlots: { customRender: 'locationDesc' }
  },
  {
    title: i18n.t('productionPlant'),
    dataIndex: 'manufacturer',
    scopedSlots: { customRender: 'manufacturer' },
    customRender: (text, record, index) => {
      return text ? Vue.$store.getters.getDictCodeObj('manufacturerDictCode')[text] || text : '-'
    },
    width: 100
  },
  {
    title: i18n.t('生产批次'),
    dataIndex: 'produceBatch',
    scopedSlots: { customRender: 'produceBatch' },
    width: 200
  },
  {
    title: i18n.t('productionYear'),
    dataIndex: 'productionTime',
    scopedSlots: { customRender: 'productionTime' },
    width: 140
  },
  {
    title: '下线时间',
    dataIndex: 'offLineTime',
    scopedSlots: { customRender: 'offLineTime' },
    width: 140
  },
  {
    title: i18n.t('creator'),
    dataIndex: 'createBy',
    scopedSlots: { customRender: 'createBy' },
    width: 140
  },
  {
    title: i18n.t('timeOfCreation'),
    dataIndex: 'createTime',
    scopedSlots: { customRender: 'createTime' },
    customRender: (text, record, index) => {
      return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : '-'
    },
    width: 200,
    sorter: true
  },
  {
    title: i18n.t('operation'),
    dataIndex: 'operation',
    fixed: 'right',
    scopedSlots: { customRender: 'operation' },
    width: 340
  }
]
export const testVehicleColumns = [
  {
    title: 'VIN',
    dataIndex: 'vin',
    scopedSlots: { customRender: 'vin' },
    width: 220
  },
  {
    title: '品牌',
    dataIndex: 'company',
    scopedSlots: { customRender: 'company' },
    customRender: (text, record, index) => {
      return Vue.$store.getters.getDictCodeObj('companyDictCode')[text] || text;
    },
    width: 100
  },
  {
    title: i18n.t('brandName'),
    dataIndex: 'brandName',
    scopedSlots: { customRender: 'brandName' },
    width: 140
  },
  {
    title: i18n.t('modelName'),
    dataIndex: 'modelName',
    scopedSlots: { customRender: 'modelName' },
    width: 140
  },
  {
    title: '车型代码',
    dataIndex: 'modelCode',
    scopedSlots: { customRender: 'modelCode' },
    width: 140
  },
  {
    title: '生产车系名称',
    dataIndex: 'productionSeries',
    scopedSlots: { customRender: 'productionSeries' },
    width: 140
  },
  {
    title: '款型名称',
    dataIndex: 'modelStyleName',
    scopedSlots: { customRender: 'modelStyleName' },
    width: 100
  },
  {
    title: '子车型代码',
    scopedSlots: { customRender: 'subModelCode' },
    width: 140
  },
  {
    title: '生产车型名称',
    dataIndex: 'productionModel',
    scopedSlots: { customRender: 'productionModel' },
    width: 140
  },
  {
    title: '公告车型',
    dataIndex: 'publishCode',
    scopedSlots: { customRender: 'publishCode' },
    width: 120
  },
  {
    title: i18n.t('年款'),
    scopedSlots: { customRender: 'makeYear' },
    width: 80
  },
  {
    title: i18n.t('车辆大版本'),
    dataIndex: 'gcyVehicleVersion',
    scopedSlots: { customRender: 'gcyVehicleVersion' },
    width: 100
  },
  {
    title: i18n.t('智驾域版本'),
    dataIndex: 'vehicleVersion',
    scopedSlots: { customRender: 'vehicleVersion' },
    width: 100
  },
  {
    title: i18n.t('Dilink版本'),
    dataIndex: 'dilinkVersion',
    scopedSlots: { customRender: 'dilinkVersion' },
    width: 100
  },
  {
    title: i18n.t('最近升级时间'),
    dataIndex: 'lastUpgradeSuccessTime',
    scopedSlots: { customRender: 'lastUpgradeSuccessTime' },
    customRender: (text, record, index) => {
      return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : '-'
    },
    width: 160
  },
  {
    title: '主机零件号',
    dataIndex: 'mainframePartCode',
    scopedSlots: { customRender: 'mainframePartCode' },
    width: 140
  },
  {
    title: '主机SN',
    dataIndex: 'mainframeSn',
    scopedSlots: { customRender: 'mainframeSn' },
    width: 100
  },
  {
    title: 'ICCID',
    dataIndex: 'iccId',
    scopedSlots: { customRender: 'iccId' },
    width: 200
  },
  {
    title: '库位',
    dataIndex: 'locationDesc',
    width: 100,
    scopedSlots: { customRender: 'locationDesc' }
  },
  {
    title: i18n.t('productionPlant'),
    dataIndex: 'manufacturer',
    scopedSlots: { customRender: 'manufacturer' },
    customRender: (text, record, index) => {
      return text ? Vue.$store.getters.getDictCodeObj('manufacturerDictCode')[text] || text : '-'
    },
    width: 100
  },
  {
    title: i18n.t('productionYear'),
    dataIndex: 'productionTime',
    scopedSlots: { customRender: 'productionTime' },
    width: 140
  },
  {
    title: '下线时间',
    dataIndex: 'offLineTime',
    scopedSlots: { customRender: 'offLineTime' },
    width: 140
  },
  {
    title: i18n.t('vehicleType'),
    dataIndex: 'vehicleType',
    scopedSlots: { customRender: 'vehicleType' },
    customRender: (text, record, index) => {
      return i18n.t(Vue.$store.state.vehicle.types.find(item => item.id == text).name);
    },
    width: 100
  },
  {
    title: i18n.t('timeOfCreation'),
    dataIndex: 'createTime',
    scopedSlots: { customRender: 'createTime' },
    customRender: (text, record, index) => {
      return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : '-'
    },
    width: 200,
    sorter: true
  },
  {
    title: i18n.t('creator'),
    scopedSlots: { customRender: 'createBy' },
    dataIndex: 'createBy',
    width: 140
  },
  {
    title: i18n.t('数据来源'),
    dataIndex: 'dataType',
    scopedSlots: { customRender: 'dataType' },
    customRender: (text, record, index) => {
      return Vue.$store.getters.getDictCodeObj('configModelDataFromDictCode')[text] || text;
    },
    width: 100
  },
  {
    title: '审核状态',
    dataIndex: 'carAuditStatus',
    scopedSlots: { customRender: 'carAuditStatus' },
    customRender: (text, record, index) => {
      if(text == 0){
        return "待审批"
      }else if(text == 1){
        return "审批中"
      }else if(text == 2){
        return "审批通过"
      }else if(text == 3){
         return "驳回"
       }else if(text == 4){
        return "撤回"
      }else{
        return "-"
      }
    },
    width: 100
  },
  {
    title: '使用方',
    dataIndex: 'user',
    scopedSlots: { customRender: 'user' },
    width: 100
  },
  {
    title: '车辆状态',
    dataIndex: 'status',
    scopedSlots: { customRender: 'status' },
    width: 100
  },
  {
    title: i18n.t('operation'),
    dataIndex: 'operation',
    fixed: 'right',
    scopedSlots: { customRender: 'operation' },
    width: 425
  }
]
export const importColumns = [
  {
    title: 'VIN',
    dataIndex: 'vin',
    scopedSlots: { customRender: 'vin' },
    width: 240
  },
  {
    title: i18n.t('vehicleType'),
    dataIndex: 'vehicleType',
    customRender: (text, record, index) => {
      return i18n.t(Vue.$store.state.vehicle.types.find(item => item.id == text).name);
    },
    width: 100
  },
  {
    title: '生产车系',
    dataIndex: 'productionSeries',
    width: 140
  },
  {
    title: '生产车型',
    dataIndex: 'productionModel',
    width: 140
  },
  {
    title: i18n.t('productionPlant'),
    dataIndex: 'manufacturer',
    customRender: (text, record, index) => {
      return Vue.$store.getters.getDictCodeObj('manufacturerDictCode')[text] || text;
    },
    width: 100
  },
  {
    title: i18n.t('productionYear'),
    dataIndex: 'productionTime',
    width: 140
  },
  {
    title: '库位',
    dataIndex: 'location',
    customRender: (text, record, index) => {
      return Vue.$store.getters.getDictCodeObj('binlocationDictCode')[text] || text;
    },
    width: 100
  },
  {
    title: '车辆阶段',
    dataIndex: 'producePhase',
    width: 100
  },
  {
    title: 'DiLink零件号',
    dataIndex: 'mainframePartCode',
    width: 120
  },
  {
    title: '主机SN',
    dataIndex: 'mainframeSn',
    width: 100
  },
  {
    title: 'ICCID',
    dataIndex: 'iccId',
    width: 200
  }
]
// 新建车辆中车型零件表头
export const ecuTbColumns = [
  {
    title: i18n.t('partName'),
    dataIndex: 'name',
    scopedSlots: { customRender: 'name' },
    width: 200
  },
  {
    title: i18n.t('partNumber'),
    dataIndex: 'ecuModuleId',
    scopedSlots: { customRender: 'partNumber' },
    width: 200
  },
  {
    title: i18n.t('ecuSoftCode'),
    dataIndex: 'softwareCode',
    scopedSlots: { customRender: 'softwareCode' },
    width: 200
  },
  {
    title: `${i18n.t('diagnosisID')}`,
    dataIndex: 'ecuDiaId',
    scopedSlots: { customRender: 'nodeAddress' },
    width: 150
  },
  {
    title: i18n.t('softDid'),
    dataIndex: 'ecuDid',
    scopedSlots: { customRender: 'softwareDid' },
    width: 150
  },
  {
    title: i18n.t('manufacturer'),
    dataIndex: 'supplier.fullName',
    scopedSlots: { customRender: 'supplier.fullName' },
    width: 200
  },
  {
    title: i18n.t('OS'),
    dataIndex: 'platform',
    scopedSlots: { customRender: 'platform' },
    width: 100
  }
]

// 车辆应用列表表头
export const vehicleTbColumns = [
  {
    title: i18n.t('applicationName'),
    dataIndex: 'appName',
    scopedSlots: { customRender: 'softwareName' },
    width: 160
  },
  {
    title: i18n.t('partNumber'),
    dataIndex: 'partNumber',
    scopedSlots: { customRender: 'partNumber' },
    width: 220
  },
  {
    title: i18n.t('partName'),
    dataIndex: 'ecuName',
    scopedSlots: { customRender: 'name' },
    width: 220
  },
  {
    title: i18n.t('partSN'),
    dataIndex: 'sn',
    scopedSlots: { customRender: 'partSN' },
    width: 150
  },
  {
    title: i18n.t('currentVersion'),
    dataIndex: 'versionName',
    scopedSlots: { customRender: 'currentVersion' },
    width: 150
  },
  {
    title: i18n.t('operation'),
    dataIndex: 'upgradeInformation',
    scopedSlots: { customRender: 'operation' },
    width: 100
  }
]
export const carModelDetailServicesColumns = [
  {
    title: i18n.t('serviceCode'),
    dataIndex: 'serviceCode',
    scopedSlots: { customRender: 'serviceCode' },
    width: 230
  },
  {
    title: i18n.t('serviceName'),
    dataIndex: 'serviceName',
    scopedSlots: { customRender: 'serviceName' },
    width: 190
  },
  {
    title: i18n.t('serviceExpireDate'),
    dataIndex: 'expiration',
    scopedSlots: { customRender: 'serviceExpireDate' },
    width: 190,
    sorter: true
  },
  {
    title: i18n.t('subscriptionState'),
    dataIndex: 'activeStatus',
    scopedSlots: { customRender: 'subscriptionState' },
    width: 190
  },
  {
    title: i18n.t('operation'),
    dataIndex: '',
    scopedSlots: { customRender: 'action' },
    width: 140,
    fixed: 'right'
  }
]

// 车辆卡片操作菜单列表
export const vehicleTbRowAction = [
  // {
  //   title: i18n.t('edit') + i18n.t('vehicle'),
  //   key: 'handleEdit',
  //   getAuth () {
  //     return managePerms.vehicle.edit
  //   },
  //   disabled () {
  //     return false
  //   }
  // },
  // {
  //   title: i18n.t('delete') + i18n.t('vehicle'),
  //   key: 'deleteList',
  //   getAuth () {
  //     return managePerms.vehicle.delete
  //   },
  //   disabled () {
  //     return false
  //   }
  // }
]
// 档案详情车辆ECU列表
export const archivesVehicleEcuColumns = [
  {
    title: i18n.t('partName'),
    dataIndex: 'ecuName',
    scopedSlots: { customRender: 'ecuName' },
    width: 200
  },
  {
    title: i18n.t('partNumber'),
    dataIndex: 'ecuModuleId',
    scopedSlots: { customRender: 'partNumber' },
    width: 240
  },
  {
    title: 'ECU变更来源',
    dataIndex: 'ecuChangeOrigin',
    scopedSlots: { customRender: 'ecuChangeOrigin' },
    width: 160
  },
  {
    title: '更新时间',
    dataIndex: 'updateTime',
    scopedSlots: { customRender: 'updateTime' },
    customRender: (text, record, index) => {
      if (text) {
        return moment(text).format('YYYY-MM-DD HH:mm:ss')
      } else if (record.createTime) {
        return moment(record.createTime).format('YYYY-MM-DD HH:mm:ss')
      } else {
        return '-'
      }
    },
    width: 200
  },
  {
    title: '软件编码[车端上报]',
    dataIndex: 'currentEcuSoftwareCode',
    scopedSlots: { customRender: 'currentEcuSoftwareCode' },
    width: 200
  },
  {
    title: '软件编码[云端录入]',
    dataIndex: 'softwareCode',
    scopedSlots: { customRender: 'softwareCode' },
    width: 200
  },
  {
    title: '当前软件版本',
    dataIndex: 'version',
    scopedSlots: { customRender: 'currentVersion' },
    width: 180
  },
  {
    title: i18n.t('hardVersion'),
    dataIndex: 'hardVersion',
    scopedSlots: { customRender: 'hardVersion' },
    width: 180
  },
  {
    title: i18n.t('supplier'),
    dataIndex: 'supplier',
    scopedSlots: { customRender: 'supplier' },
    width: 120
  },
  {
    title: i18n.t('operation'),
    dataIndex: 'action',
    scopedSlots: { customRender: 'action' },
    width: 220,
    fixed: 'right'
  }
]
// 档案详情车辆ECU版本同步历史列表
export const versionSyncHistoryColumns = [
  {
    title: i18n.t('ECU变更来源'),
    dataIndex: 'ecuChangeOrigin',
    scopedSlots: { customRender: 'ecuChangeOrigin' },
    width: 160
  },
  {
    title: '软件编码[车端上报]',
    dataIndex: 'softwareCode',
    scopedSlots: { customRender: 'softwareCode' },
    width: 150
  },
  {
    title: '软件编码[云端录入]',
    dataIndex: 'cloudSoftwareCode',
    scopedSlots: { customRender: 'cloudSoftwareCode' },
    width: 150
  },
  {
    title: '当前软件版本',
    dataIndex: 'version',
    scopedSlots: { customRender: 'version' },
    width: 120
  },
  {
    title: i18n.t('hardVersion'),
    dataIndex: 'hardVersion',
    scopedSlots: { customRender: 'hardVersion' },
    width: 120
  },
  {
    title: '数据上报时间',
    dataIndex: 'dataReportTime',
    scopedSlots: { customRender: 'dataReportTime' },
    customRender: (text, record, index) => {
      return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : '-'
    },
    width: 180
  }
]
// 档案详情车辆ECU版本升级历史列表
export const ecuUpgradeHistoryColumns = [
  {
    title: i18n.t('任务名称'),
    dataIndex: 'taskName',
    scopedSlots: { customRender: 'taskName' },
    width: 300
  },
  {
    title: i18n.t('OTA任务类型'),
    dataIndex: 'taskType',
    scopedSlots: { customRender: 'taskType' },
    width: 160
  },
  {
    title: i18n.t('升级类型'),
    dataIndex: 'updateTypeDesc',
    scopedSlots: { customRender: 'updateTypeDesc' },
    width: 200
  },
  /*{
    title: i18n.t('升级方式'),
    dataIndex: 'updatePathDesc',
    scopedSlots: { customRender: 'updatePathDesc' },
    width: 160
  },*/
  {
    title: i18n.t('源车辆版本'),
    dataIndex: 'originVehicleVersion',
    scopedSlots: { customRender: 'originVehicleVersion' },
    width: 160
  },
  {
    title: i18n.t('目标车辆版本'),
    dataIndex: 'targetVehicleVersion',
    scopedSlots: { customRender: 'targetVehicleVersion' },
    width: 160
  },
  {
    title: i18n.t('源ECU版本'),
    dataIndex: 'originEcuVersion',
    scopedSlots: { customRender: 'originEcuVersion' },
    width: 160
  },
  {
    title: i18n.t('目标ECU版本'),
    dataIndex: 'targetEcuVersion',
    scopedSlots: { customRender: 'targetEcuVersion' },
    width: 160
  },
  {
    title: i18n.t('升级结果'),
    dataIndex: 'upgradeResult',
    scopedSlots: { customRender: 'upgradeResult' },
    customRender: (text, record, index) => {
      return text ? Vue.$store.getters.getDictCodeObj('taskVehicleStatusDictCode')[text] || text : '-'
    },
    width: 160
  },
  {
    title: i18n.t('状态码'),
    dataIndex: 'code',
    scopedSlots: { customRender: 'code' },
    width: 160
  },
  // {
  //   title: i18n.t('operation'),
  //   dataIndex: 'operation',
  //   fixed: 'right',
  //   scopedSlots: { customRender: 'operation' },
  //   width: 100
  // }
]
// 档案详情车辆历史版本列表
export const carModelHistoricalVersionListColumns = [
  {
    title: i18n.t('车辆大版本'),
    dataIndex: 'gcyVehicleVersion',
    scopedSlots: { customRender: 'gcyVehicleVersion' },
    width: 160
  },
  {
    title: i18n.t('智驾域版本'),
    dataIndex: 'vehicleVersion',
    scopedSlots: { customRender: 'vehicleVersion' },
    width: 160
  },
  {
    title: i18n.t('ECU版本'),
    scopedSlots: { customRender: 'ecuVersion' },
    width: 160
  },
  {
    title: i18n.t('品牌名称'),
    dataIndex: 'company',
    scopedSlots: { customRender: 'company' },
    width: 160
  },
  {
    title: i18n.t('车系名称'),
    dataIndex: 'brandName',
    scopedSlots: { customRender: 'brandName' },
    width: 160
  },
  {
    title: i18n.t('车型名称'),
    dataIndex: 'modelName',
    scopedSlots: { customRender: 'modelName' },
    width: 160
  },
  {
    title: i18n.t('款型名称'),
    dataIndex: 'modelStyleName',
    scopedSlots: { customRender: 'modelStyleName' },
    width: 160
  },
  {
    title: i18n.t('车型代码'),
    dataIndex: 'modelCode',
    scopedSlots: { customRender: 'modelCode' },
    width: 160
  },
  {
    title: i18n.t('子车型代码'),
    dataIndex: 'modelStyleCode',
    scopedSlots: { customRender: 'modelStyleCode' },
    width: 160
  },
  {
    title: i18n.t('创建日期'),
    dataIndex: 'createTime',
    scopedSlots: { customRender: 'createTime' },
    customRender: (text, record, index) => {
      return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : '-'
    },
    width: 180
  }
]
// 档案详情FOTA历史列表
export const fotaHistoryListColumns = [
  {
    title: i18n.t('任务名称'),
    dataIndex: 'taskName',
    scopedSlots: { customRender: 'taskName' },
    width: 300
  },
  {
    title: i18n.t('任务车辆升级状态'),
    dataIndex: 'taskVehicleUpgradeStatus',
    scopedSlots: { customRender: 'taskVehicleUpgradeStatus' },
    width: 160
  },
  {
    title: i18n.t('任务批次号'),
    dataIndex: 'batchId',
    scopedSlots: { customRender: 'batchId' },
    width: 300
  },
  {
    title: i18n.t('OTA任务类型'),
    dataIndex: 'taskBigType',
    scopedSlots: { customRender: 'taskBigType' },
    width: 160
  },
  {
    title: i18n.t('升级类型'),
    dataIndex: 'upgradeType',
    scopedSlots: { customRender: 'upgradeType' },
    width: 180
  },
  {
    title: i18n.t('源车辆大版本'),
    dataIndex: 'normalOriginVer',
    scopedSlots: { customRender: 'normalOriginVer' },
    sorter: true,
    width: 160
  },
  {
    title: i18n.t('目标车辆大版本'),
    dataIndex: 'normalVersion',
    scopedSlots: { customRender: 'normalVersion' },
    sorter: true,
    width: 160
  },
  // {
  //   title: i18n.t('源智驾域版本'),
  //   dataIndex: 'xxx',
  //   scopedSlots: { customRender: 'xxx' },
  //   width: 160
  // },
  // {
  //   title: i18n.t('目标智驾域版本'),
  //   dataIndex: 'xxx',
  //   scopedSlots: { customRender: 'xxx' },
  //   width: 160
  // },
  {
    title: i18n.t('升级结果'),
    dataIndex: 'upgradeResult',
    scopedSlots: { customRender: 'upgradeResult' },
    customRender: (text, record, index) => {
      return text ? Vue.$store.getters.getDictCodeObj('taskVehicleStatusDictCode')[text] || text : '-'
    },
    width: 160
  },
  {
    title: i18n.t('状态码'),
    dataIndex: 'normalStatus',
    scopedSlots: { customRender: 'normalStatus' },
    width: 160
  },
  {
    title: i18n.t('升级描述'),
    dataIndex: 'upgradeDesc',
    scopedSlots: { customRender: 'upgradeDesc' },
    width: 400
  },
  {
    title: i18n.t('用户告知'),
    dataIndex: 'updateNoteInfo',
    scopedSlots: { customRender: 'updateNoteInfo' },
    width: 160
  },
  {
    title: i18n.t('DiLink版本'),
    dataIndex: 'mediaVersion',
    scopedSlots: { customRender: 'mediaVersion' },
    width: 160
  },
  {
    title: i18n.t('数据上报时间'),
    dataIndex: 'createTime',
    scopedSlots: { customRender: 'createTime' },
    customRender: (text, record, index) => {
      return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : '-'
    },
    width: 180,
    sorter: true
  },
  {
    title: i18n.t('operation'),
    dataIndex: 'operation',
    fixed: 'right',
    scopedSlots: { customRender: 'operation' },
    width: 245
  }
]
// 档案详情ECU升级详情列表
export const ecuUpgradeDetails = [
  {
    title: i18n.t('ECU名称'),
    dataIndex: 'ecuName',
    scopedSlots: { customRender: 'ecuName' },
    width: 160
  },
  {
    title: i18n.t('ECU ID'),
    dataIndex: 'ecuId',
    scopedSlots: { customRender: 'ecuId' },
    width: 220
  },
  {
    title: i18n.t('是否任务ECU'),
    dataIndex: 'displayDetail',
    scopedSlots: { customRender: 'displayDetail' },
    customRender: (text, record, index) => {
      return text ? '是' : '否'
    },
    width: 160
  },
  {
    title: i18n.t('源版本'),
    dataIndex: 'ecuOriginSVer',
    scopedSlots: { customRender: 'ecuOriginSVer' },
    width: 160
  },
  {
    title: i18n.t('目标版本'),
    dataIndex: 'ecuSoftVer',
    scopedSlots: { customRender: 'ecuSoftVer' },
    width: 160
  },
  {
    title: i18n.t('升级结果'),
    dataIndex: 'ecuUpgradeResult',
    scopedSlots: { customRender: 'ecuUpgradeResult' },
    customRender: (text, record, index) => {
      return text ? Vue.$store.getters.getDictCodeObj('taskVehicleStatusDictCode')[text] || text : '-'
    },
    width: 160
  },
  {
    title: i18n.t('升级时长(s)'),
    dataIndex: 'ecuTime',
    scopedSlots: { customRender: 'ecuTime' },
    width: 160
  },
  {
    title: i18n.t('状态码'),
    dataIndex: 'ecuStatus',
    scopedSlots: { customRender: 'ecuStatus' },
    width: 160
  },
  {
    title: i18n.t('是否配置文件'),
    dataIndex: 'configFile',
    scopedSlots: { customRender: 'configFile' },
    width: 160
  },
  {
    title: i18n.t('软件编码'),
    dataIndex: 'ecuSoftCode',
    scopedSlots: { customRender: 'ecuSoftCode' },
    width: 200
  },
  {
    title: i18n.t('供应商'),
    dataIndex: 'supplier',
    scopedSlots: { customRender: 'supplier' },
    width: 160
  },
  {
    title: i18n.t('硬件版本号'),
    dataIndex: 'ecuHardVer',
    scopedSlots: { customRender: 'ecuHardVer' },
    width: 160
  },
  {
    title: i18n.t('是否清除故障码'),
    dataIndex: 'diagnosticTroubleCodeDel',
    scopedSlots: { customRender: 'diagnosticTroubleCodeDel' },
    width: 160
  },
  {
    title: '数据上报时间',
    dataIndex: 'createTime',
    scopedSlots: { customRender: 'createTime' },
    customRender: (text, record, index) => {
      return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : '-'
    },
    width: 180
  },
  // {
  //   title: i18n.t('operation'),
  //   dataIndex: 'operation',
  //   fixed: 'right',
  //   scopedSlots: { customRender: 'operation' },
  //   width: 100
  // }
]
// 档案详情车辆历史版本具体ecu版本列表
export const EcuVersionListByVehicleVersion = [
  {
    title: i18n.t('ECU名称'),
    dataIndex: 'ecuName',
    scopedSlots: { customRender: 'ecuName' },
    width: 160
  },
  {
    title: i18n.t('ECU ID'),
    dataIndex: 'ecuId',
    scopedSlots: { customRender: 'ecuId' },
    width: 240
  },
  {
    title: i18n.t('软件编码(车端上报)'),
    dataIndex: 'softwareCode',
    scopedSlots: { customRender: 'softwareCode' },
    width: 200
  },
  {
    title: i18n.t('软件编码(云端录入)'),
    dataIndex: 'cloudSoftwareCode',
    scopedSlots: { customRender: 'cloudSoftwareCode' },
    width: 200
  },
  {
    title: i18n.t('软件版本'),
    dataIndex: 'ecuVersion',
    scopedSlots: { customRender: 'ecuVersion' },
    width: 160
  },
  {
    title: i18n.t('硬件版本'),
    dataIndex: 'hardVersion',
    scopedSlots: { customRender: 'hardVersion' },
    width: 160
  }
]
// FOTA历史任务详情车辆升级信息列表
export const CarUpgradeInformationListColumns = [
  {
    title: i18n.t('VIN'),
    dataIndex: 'vin',
    scopedSlots: { customRender: 'vin' },
    width: 200
  },
  {
    title: i18n.t('车系名称'),
    dataIndex: 'brandName',
    scopedSlots: { customRender: 'brandName' },
    width: 120
  },
  {
    title: i18n.t('车型名称'),
    dataIndex: 'modelName',
    scopedSlots: { customRender: 'modelName' },
    width: 120
  },
  {
    title: i18n.t('车型代码'),
    dataIndex: 'modelCode',
    scopedSlots: { customRender: 'modelCode' },
    width: 160
  },
  {
    title: i18n.t('款型名称'),
    dataIndex: 'trimLevel',
    scopedSlots: { customRender: 'trimLevel' },
    width: 160
  },
  {
    title: i18n.t('子车型代码'),
    dataIndex: 'modelStyleCode',
    scopedSlots: { customRender: 'modelStyleCode' },
    width: 160
  },
  {
    title: i18n.t('公告车型'),
    dataIndex: 'publishCode',
    scopedSlots: { customRender: 'publishCode' },
    width: 160
  },
  {
    title: i18n.t('年款'),
    dataIndex: 'makeYear',
    scopedSlots: { customRender: 'makeYear' },
    width: 160
  },
  {
    title: i18n.t('升级结果'),
    dataIndex: 'status',
    scopedSlots: { customRender: 'status' },
    customRender: (text, record, index) => {
      return text ? Vue.$store.getters.getDictCodeObj('taskVehicleStatusDictCode')[text] || text : '-'
    },
    width: 160
  }
]
